<?php
namespace app\admin\controller;
use think\Controller;

class Base extends Controller  //控制器层
{

	
	
    
	
	
		public function status(){

		$data = input('get.');
		/* $validate=validate('Featured');
		 if(!$validate->scene('status')->check($data)){
			 $this->error($validate->getError()); 
			 }   */
		 
		 if(empty($data['id'])){
			 $this->error('id不合法');
			 }
		 if(!is_numeric($data['status'])){
			 $this->error('status不合法');
			 }
		 
		 
		 //获取控制器
		 $model = request()->controller();
		 $res = model($model)->save(['status'=>$data['status']], ['id'=>$data['id']]);
		 if($res){
			 $this->success('状态更新成功');
			 }else{
				$this->error('状态更新失败');
				 }
		 
		}	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
?>